# super class
class Animal():
    def __init__(self,name,age):
        self.name = name
        self.age = age

    def run(self):
        print("Animal is running")

# base class
# driver class
class Dog(Animal):
    def __init__(self,name,age,type):
        # self.name = name
        # self.age = age
        # super().__init__(name,age)
        Animal.__init__(self,name,age) #注意是类名，不加括号，以及self
        self.type = type

    def run(self):
        print("dog is running ")

class Cat(Animal):
    def __init__(self,name,age,type):
        # self.name = name
        # self.age = age
        # super().__init__(name,age)
        Animal.__init__(self,name,age) #注意是类名，不加括号，以及self
        self.type = type

    def run(self):
        print("cat is running ")


def run2(animal):
    animal.run()

if __name__ == '__main__':
    a = Animal("a",3)
    d = Dog("d",2,"keji")
    c = Cat("c",2,"yingshort")
    # print(d.name)
    # print(d.age)
    # print(d.type)
    run2(a)
    run2(d)
    run2(c)
